<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>keyevent</title>
    <style>
        .haha{
            background-color: pink;
            height:200px;
            width:700px;
        }
    </style>
</head>
<body>

    <div id="app" >
        <button @click="flag = !flag">点击切换</button>
        <div v-bind:class="{haha:flag}"></div>
    </div>
</body>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
    let vm = new Vue({
        el:"#app",
        data:{

            flag:true
        },

    })
</script>
</html>